// 模型层
import {
  HTTP
} from 'utils/http';
import config from 'utils/config';

class DetailModel extends HTTP {
  /**
   * 请求首页数据s
   * @param {*} field food/ktv/massage/city/hotel
   * @param {*} id 城市id
   * @return 返回一个Promise对象resolve抛出响应的数据
   */
  getDetail(field, id) {
    return new Promise((resolve, reject) => {
      this.axiosPost({
        url: config.API.GET_DETAIL,
        data: {
          field,
          id
        },
        success: function (data) {
          resolve({
            data,
            status: 0
          });
        },
        error: function (err) {
          resolve({
            status: -1
          });
        }
      });
    });
  }
}

export {
  DetailModel
};
